<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style type="text/css">
	.emptable {
		background-color: gray;
	}
</style>
<script type="text/javascript" src="script/PDT1000MO.js" defer="defer"></script>
<script type="text/javascript" src="js/jquery-1.11.0.js"></script>

<script src='http://code.jquery.com/ui/1.10.4/jquery-ui.js' type='text/javascript'></script>
<link rel='stylesheet' href='http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
</head>
<body>
	<form action="doPDTMainView.do" method="post">
		<table border="1" cellspacing="0" align="center" width="80%" frame="box" rules="none">
			<tr>
				<td width="26%">
					판매개시일자<br>
					<input type="text" size="10" name="saleSearch1" id="date1" value="${initSaleSearch1 }">
					<input type="text" size="10" name="saleSearch2" id="date2" value="${initSaleSearch2 }">
				</td>
				<td width="70%">
					상품명<br>
					<input type="text" name="productName" value="${searchMap.productName }"><input type="submit" value="조회">
				</td>
				<td>
					<br>
					<a href="javascript:doPDTInsView('I')"><input type="button" value="신규등록"></a>
				</td>
			</tr>
		</table>
	</form>
	<br>
	<table border="1" cellspacing="0" align="center" width="80%" style="border-collapse:separate;">
		<tr>
			<td class="emptable">상품코드</td>
			<td class="emptable">상품명</td>
			<td class="emptable">품목코드</td>
			<td class="emptable">품목명</td>
			<td class="emptable">제조사</td>
			<td class="emptable">카테고리명</td>
			<td class="emptable">규격</td>
			<td class="emptable">단위</td>
			<td class="emptable">단가</td>
			<td class="emptable">주담당자</td>
			<td class="emptable">판매개시일자</td>
			<td class="emptable">판매종료일자</td>
			<td class="emptable">조회</td>
		</tr>
		<c:forEach var="i" items="${listPDT }" varStatus="ct">
			<tr>                                                    
				<td>
					<a href="javascript:doPDTInsView('M',${i.PRODUCT_NUM })">${i.PRODUCT_CODE}</a>
				</td>                        
				<td>
					<a href="javascript:doPDTInsView('M',${i.PRODUCT_NUM })">${i.PRODUCT_NAME}</a>
				</td>                            
				<td>${i.ITEM_CODE}</td>                               
				<td>${i.ITEM_NAME}</td>                               
				<td>${i.MANUFACTURE_NAME}</td> 
				<td>${i.CATEGORY_NAME }</td>                       
				<td>${i.STANDARD}</td>                                
				<td>${i.UNIT_CODE}</td>                               
				<td>${i.UNIT_PRICE}</td>                              
				<td>${i.EMPLOYEE_NAME}</td>                           
				<td>${i.SALE_STIME}</td>                              
				<td>${i.SALE_ETIME}</td> 
				<td><a href="javascript:doPDTInsView('V',${i.PRODUCT_NUM })"><input type="button" value="조회"></a></td>
			</tr>                                                   
				<c:set var="count" value="${ct.count }"/>                             
		</c:forEach>
		<c:forEach var="i" begin="1" end="${10-count }">
			<tr>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>
				<td style="padding-right: 10px; padding-left: 10px; padding-bottom: 10px; padding-top: 10px"></td>	
			</tr>
		</c:forEach>	
	</table>
<div id="paging" align="center">	
	<c:forEach var="k" begin="${pageBean.startPage}" end="${pageBean.endPage }">
	    <c:choose>
	      <c:when test="${k eq pageBean.currentPage }">
	       <font color="red" size="4">[${k}]</font>
	      </c:when>
	      <c:otherwise>
	      	<a href="javascript:searchPDT(${k})">[${k }]</a>
	      </c:otherwise>						      
	    </c:choose>
	</c:forEach>	
</div>
<form action="doPDTMainView.do" method="post" name="searchForm">
	<input type="hidden" name="saleSearch1" value="${searchMap.saleSearch1}">
	<input type="hidden" name="saleSearch2" value="${searchMap.saleSearch2}">
	<input type="hidden" name="productName" value="${searchMap.productName}">
	<input type="hidden" name="page" value="${pageBean.currentPage }">
</form>
${errMsg }
</body>
</html>